﻿/********************************************************************************
** @ Date:2025/05/28
** @ Author: Gaojia
** @ Description:
** @ Version:1.0.0
** @ Fun:
********************************************************************************/
#ifndef UStateInfoPanel_H
#define UStateInfoPanel_H
#include <QWidget>
#include "ui_UStateInfoPanel.h"
#include "UBasePanel.h"
#include "CRobCtrMange.h"
#include "CCamerCtrMange.h"
#include "CRobAlarmDlg.h"
enum EState
{
	enNormal,//运行正常，指示灯灰色
	enWorking,//运行正常，指示灯绿色
	enAlarm,//报警，指示灯红
	enWarning,//故障，指示灯黄
};

class UStateInfoPanel : public UBasePanel
{
	Q_OBJECT

public:
	UStateInfoPanel(QWidget *parent = nullptr);
	~UStateInfoPanel();
	void timerStart();                                    //开启定时器
protected:
	void init();
private:
	void setStyleSheetFile();	                          //设置界面样式表
	void initConnect();                                   //初始化槽函数连接
	void initState();                                     //初始化界面状态
	void setRunningStateLableSheet(EState enState);       //设置运行状态指示灯
	void setCommunicationStateLableSheet(EState enState); //设置通信状态指示灯
	void setAlarmLableSheet(EState enState);			  //设置报警状态指示灯
	void setChargStateLableSheet(EState enState);         //设置充电状态指示灯
	void setRobStateLableSheet(EState enState);           //设置机器人设备状态指示灯
	void setYTStateLableSheet(EState enState);            //设置云台状态指示灯
	void setBeltALableSheet(EState enState);              //设置A侧皮带启停指示灯
	void setBeltBLableSheet(EState enState);              //设置B侧皮带启停指示灯

	void setEmergencyStopDown();                          //设置急停按下样式
	void setEmergencyStopUp();                            //设置急停松开样式
public slots:
	void slotPushButtonEmergencyStopClicked();            //急停按钮槽函数
	void slotPushButtonAlarmClicked();			          //点击报警对话框按钮
	void slotDataRefresh();                               //定时器刷新
	void slotAlarm(bool bIsAlarm);
private:
	Ui::UStateInfoPanelClass ui;
	QString m_sNormalLamp;                      //指示灯灭样式表字符串
	QString m_sWorkLamp;                        //指示灯绿灯样式表字符串
	QString m_sAlarmLamp;                       //指示红灯样式表字符串
	QString m_sWarningLamp;                     //指示黄灯样式表字符串
	bool m_bIsStopButtonClicked;                //急停按钮当前是否被按下
	int m_nCount;                               //定时器循环次数
	bool m_bIsAlarm;
	CRobAlarmDlg* m_pAlarmDlg;
	int  m_nVoiceCount;
};
#endif